<div class="box">
    <?php if(!empty($news)) { ?>
    <div class="grid">
        <div class="row">
            <h3 class="grid_title"><?php echo $category; ?></h3>
            <?php foreach ($news as $key => $value) {
                if(SLUG_ACTIVE==0){
                    $uri = get_base_url() . url_title(trim($value->title), 'dash', TRUE) . '-ns' . $value->id;
                }else{
                    $uri = get_base_url() . $value->slug;
                }
                $image = isset($value->thumbnail)?$value->thumbnail:base_url().'images/no-image.png';
                $value_title = limit_text($value->title, 100);
                $value_summary = limit_text($value->summary, 300);
                $value_category = limit_text($value->category, 100);
                $created_date   = get_date_by_lang(get_language(), $value->created_date);
                $author = $value->creator_fullname;
            ?>
            <div class="col-sm-6 item">
                <div class="item-image">
                    <a title="<?php echo $value->title; ?>" href="<?php echo $uri; ?>">
                        <img alt="" title="<?php echo $value->title; ?>" src="<?php echo $image; ?>" />
                    </a>
                </div>
                <span class="category"><a href="#"><?php echo $value_category; ?></a></span>
                <span class="item-comments">
                    <a title="Bình luận bài <?php echo $value->title; ?>" href="<?php echo $uri; ?>#comments">
                        <span class="fb_comments_count"><?php echo $value->viewed; ?></span> Lượt xem
                    </a>
                </span>
                <h3><a title="<?php echo $value->title; ?>" href="<?php echo $uri; ?>"><?php echo $value_title; ?></a></h3>
                <p><?php echo $value_summary; ?></p>
                <span class="item_meta">Đăng vào <?php echo $created_date; ?> <span class="line">/</span> bởi <?php echo $author; ?></span>
            </div>
            <?php } ?>
        </div>
    </div>
    <div class="paging">
        <?php echo $this->pagination->create_links(); ?>
    </div>
    <?php } ?>
    
</div>
